<?php
	$data  = include "goodsdb.php";
	$id = $_GET['id'];
	//当前$id的商品点击数加1
	$data[$id]['click']++;
	file_put_contents("goodsdb.php","<?php \nreturn ".var_export($data,true).";\n?>");
	//将点击次数输出，因为视图是用<scritp>标签调用的，所以要输出JS语法
	echo "document.write(".$data[$id]['click'].")";
?>